import 'package:flutter/material.dart';

class MyApp10 extends StatelessWidget {
  const MyApp10({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Expanded组件'),
        centerTitle: true,
        backgroundColor: Colors.lightGreen,
      ),
      body: Center(
        child: Container(
          width: MediaQuery.of(context).size.width,
          height: 120,
          color: Colors.cyan,
          child: Row(
            children: [
              Expanded(
                flex: 1,
                child: Container(
                  height: 80,
                  color: Colors.blueAccent,
                  child: Text('11111111'),
                ),
              ),
              Expanded(
                flex: 2,
                child: Container(
                  height: 80,
                  color: Colors.amber,
                  child: Text('22222222'),
                ),
              ),
              Expanded(
                flex: 3,
                child: Container(
                  height: 80,
                  color: Colors.deepOrange,
                  child: Text('33333333'),
                ),
              ),
              Expanded(
                flex: 5,
                child: Container(
                  height: 80,
                  color: Colors.green,
                  child: Text('55555555'),
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
